package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CgSancionCaso generated by hbm2java
 */
@Entity
@Table(name = "CG_SANCION_CASO", schema = "UPET")
public class CgSancionCaso implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5075138268833854322L;
	private CgSancionCasoId id;
	private TbUnidad tbUnidad;
	private CgDeficDeterm cgDeficDeterm;
	private Double vsancion;
	private String cusuario;
	private Date fhingreso;
	private Date fhmodificacion;
	private Integer bingresoExtra;

	public CgSancionCaso() {
	}

	public CgSancionCaso(CgSancionCasoId id, CgDeficDeterm cgDeficDeterm,
			String cusuario, Date fhingreso, Date fhmodificacion,
			Integer bingresoExtra) {
		this.id = id;
		this.cgDeficDeterm = cgDeficDeterm;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.bingresoExtra = bingresoExtra;
	}

	public CgSancionCaso(CgSancionCasoId id, 
			CgDeficDeterm cgDeficDeterm, Double vsancion, String cusuario,
			Date fhingreso, Date fhmodificacion, Integer bingresoExtra) {
		this.id = id;
		this.tbUnidad = tbUnidad;
		this.cgDeficDeterm = cgDeficDeterm;
		this.vsancion = vsancion;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.bingresoExtra = bingresoExtra;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "ncaso", column = @Column(name = "N_CASO", nullable = false, precision = 10, scale = 0)),
			@AttributeOverride(name = "cdeficiencia", column = @Column(name = "C_DEFICIENCIA", nullable = false, length = 4)),
			@AttributeOverride(name = "cunidad", column = @Column(name = "C_UNIDAD", nullable = false, length = 5))})
	public CgSancionCasoId getId() {
		return this.id;
	}

	public void setId(CgSancionCasoId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_UNIDAD", nullable = false, insertable = false, updatable = false)
	public TbUnidad getTbUnidad() {
		return this.tbUnidad;
	}

	public void setTbUnidad(TbUnidad tbUnidad) {
		this.tbUnidad = tbUnidad;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "N_CASO", referencedColumnName = "N_CASO", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "C_DEFICIENCIA", referencedColumnName = "C_DEFICIENCIA", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "C_UNIDAD", referencedColumnName = "C_UNIDAD", nullable = false, insertable = false, updatable = false)})
	public CgDeficDeterm getCgDeficDeterm() {
		return this.cgDeficDeterm;
	}

	public void setCgDeficDeterm(CgDeficDeterm cgDeficDeterm) {
		this.cgDeficDeterm = cgDeficDeterm;
	}

	@Column(name = "V_SANCION", precision = 13)
	public Double getVsancion() {
		return this.vsancion;
	}

	public void setVsancion(Double vsancion) {
		this.vsancion = vsancion;
	}

	@Column(name = "C_USUARIO", nullable = false, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", nullable = false, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "FH_MODIFICACION", nullable = false, length = 7)
	public Date getFhmodificacion() {
		return this.fhmodificacion;
	}

	public void setFhmodificacion(Date fhmodificacion) {
		this.fhmodificacion = fhmodificacion;
	}

	@Column(name = "B_INGRESO_EXTRA", nullable = false, precision = 1, scale = 0)
	public Integer getBingresoExtra() {
		return this.bingresoExtra;
	}

	public void setBingresoExtra(Integer bingresoExtra) {
		this.bingresoExtra = bingresoExtra;
	}

}
